package org.yaac.shared.egql;

import java.util.List;

import org.yaac.shared.property.PropertyType;

/**
 * autobean
 * 
 * @author Max Zhu (thebbsky@gmail.com)
 *
 */
public interface ResultCell {

	/**
	 * client side and server side will have different factory implementation
	 * 
	 * @author Max Zhu (thebbsky@gmail.com)
	 *
	 */
	public static interface ResultCellFactory {
		ResultCell create();
	}
	
	/**
	 * @return payload in strings used to construct PropertyInfo class in client side
	 */
	List<String> getPayload();

	void setPayload(List<String> payload);
	
	/**
	 * @return list of result cell, used in encode / decode list properties
	 * 
	 * not null only when ReturnType = LIST
	 */
	List<ResultCell> getChildren();

	void setChildren(List<ResultCell> children);

	/**
	 * @return parent key result cell
	 * not null only when the property type is Key and there is a parent key
	 */
	ResultCell getParent();
	
	void setParent(ResultCell parent);
	
	PropertyType getType();

	void setType(PropertyType resultType);

	/**
	 * @return title of this cell, by default it's the raw user input text
	 */
	String getTitle();
	
	void setTitle(String title);
	
	/**
	 * @return warnings of this property during evaluation
	 */
	List<String> getWarnings();
	
	void setWarnings(List<String> warnings);
}